package com.demo.test.flyweight;

import com.demo.test.flyweight.iml.Flyweight;

public class Client {
    public static void main(String[] agr){
        FlyweightFactory flyweightFactory = new FlyweightFactory();
        Flyweight f1 = flyweightFactory.getFlyweight("a");
        Flyweight f2 = flyweightFactory.getFlyweight("b");
        Flyweight f3 = flyweightFactory.getFlyweight("a");
        Flyweight f4 = flyweightFactory.getFlyweight("a");
        Flyweight f5 = flyweightFactory.getFlyweight("a");
        f1.operation(new UnsharedConcreteFlyweight("非享元信息a"));
        f2.operation(new UnsharedConcreteFlyweight("非享元信息b"));
        f3.operation(new UnsharedConcreteFlyweight("非享元信息3"));
        f4.operation(new UnsharedConcreteFlyweight("非享元信息4"));
        f5.operation(new UnsharedConcreteFlyweight("非享元信息5"));
    }
}
